package cn.itcast.service.impl;

import cn.itcast.entity.DishFlavor;
import cn.itcast.mapper.IDishFlavorMapper;
import cn.itcast.service.IDishFlavorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author GuoMingXi @Email guomingxi2018@163.com
 * @Create 2022/6/1 17:11
 * @Version V1.0
 */
@Service
public class DishFlavorServiceImpl implements IDishFlavorService {
    @Autowired(required = false)
    private IDishFlavorMapper dishFlavorMapper;
    /**
     * 保存数据到dish_flavor
     * @param dishFlavor
     */
    @Override
    public void save(DishFlavor dishFlavor) {
        dishFlavorMapper.Save(dishFlavor);
    }

    @Override
    public List<DishFlavor> findByDishId(Long id) {
        return dishFlavorMapper.findByDishId(id);
    }

    @Override
    public void deleteByDishId(Long id) {
        dishFlavorMapper.deleteByDishId(id);
    }
}
